package top.toptimus.dto.kashiyamaMaterial;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 面料信息
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class KashiyamaMaterialDTO {
    private String material_code; //面料
    private String supplier_name; //供应商
    private String origin; //产地
    private String quote; //面料报价
    private String grade; //等级
    private String continuity; //延续性

    /**
     * 插入数据
     *
     * @return insterSql
     */
    public String kashiyamaMaterialInsterSql() {
        return "INSERT INTO `fragsmart-erp`.`kashiyama_material` ( `MATERIAL_CODE`, `supplier_name`, " +
                "`origin`, `quote`, `grade`, `continuity` )\n" +
                "VALUES\n" +
                "	( '" + this.material_code + "', '" + this.supplier_name + "'," +
                " '" + this.origin + "', '" + this.quote + "'," +
                " '" + this.grade + "', '" + this.continuity + "' );";
    }

    /**
     * 更新数据
     *
     * @return updatesql
     */
    public String kashiyamaMaterialUpdatesql() {
        return "UPDATE `fragsmart-erp`.`kashiyama_material` \n" +
                "SET `supplier_name` = '"+this.supplier_name+"',\n" +
                "`origin` = '"+this.origin+"',\n" +
                "`quote` = '"+this.quote+"',\n" +
                "`grade` = '"+this.grade+"',\n" +
                "`continuity` = '"+this.continuity+"' \n" +
                "WHERE\n" +
                "	`MATERIAL_CODE` = '"+this.material_code+"';";
    }

}
